/*
 * Background Flickr: Copyright (C) 2009  Craig McNicholas
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.ddw.app.bflickr;

import android.content.Context;
import android.widget.RelativeLayout;
import android.widget.TextView;

/**
 * Class to build a new list item for accounts. Use the getTag() and setTag()
 * methods to store item specific data. The relative layout is clickable.
 * 
 * @author craig
 * 
 */
public class FlickrAccountListItemRelativeLayout extends RelativeLayout {

	/**
	 * Creates a new list item instance
	 * 
	 * @param context
	 */
	public FlickrAccountListItemRelativeLayout(Context context) {
		super(context);
		inflate(context, R.layout.accounts_listitem, this);
	}

	/**
	 * Getter of the headers text
	 * 
	 * @return a string containing the headers text
	 */
	public String getHeader() {
		return ((TextView) this.findViewById(R.id.AccountsListItemHeader)).getText().toString();
	}

	/**
	 * Setter of the headers text
	 * 
	 * @param header
	 *            the header string to set
	 */
	public void setHeader(String header) {
		((TextView) this.findViewById(R.id.AccountsListItemHeader)).setText(header);
	}

	/**
	 * Getter of the sub text
	 * 
	 * @return a string containing the sub text
	 */
	public String getText() {
		return ((TextView) this.findViewById(R.id.AccountsListItemText)).getText().toString();
	}

	/**
	 * Setter of the sub text
	 * 
	 * @param text
	 *            the text string to set
	 */
	public void setText(String text) {
		((TextView) this.findViewById(R.id.AccountsListItemText)).setText(text);
	}

}
